package com.coder.util;

import javax.swing.JFrame;
import javax.swing.SwingUtilities;

/**
 * 一个显式框架
 *
 * @author yuhushuan
 * @date 2020/9/7 11:29
 */
public class SwingConsole {
    public static void run(final JFrame f, final int width, final int height) {
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                f.setTitle(f.getClass().getSimpleName());
                f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                f.setSize(width, height);
                f.setVisible(true);
            }
        });
    }
}
